home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / python2.4 / test / test_threading_local.py < prev    next >
Text File  |  2005-10-18  |  679b  |  27 lines

  1. import unittest
  2. from doctest import DocTestSuite
  3. from test import test_support
  4.  
  5. def test_main():
  6.     suite = DocTestSuite('_threading_local')
  7.  
  8.     try:
  9.         from thread import _local
  10.     except ImportError:
  11.         pass
  12.     else:
  13.         import _threading_local
  14.         local_orig = _threading_local.local
  15.         def setUp(test):
  16.             _threading_local.local = _local
  17.         def tearDown(test):
  18.             _threading_local.local = local_orig
  19.         suite.addTest(DocTestSuite('_threading_local',
  20.                                    setUp=setUp, tearDown=tearDown)
  21.                       )
  22.  
  23.     test_support.run_suite(suite)
  24.  
  25. if __name__ == '__main__':
  26.     test_main()
  27.